<?php
///////////////////////////////////////////////////////////////////////////////
////	BEGIN POST INSTALL

global $sugar_config;
?>

<?php

  function post_install() {

	require_once('include/utils.php');

 	$mode = $_REQUEST['mode'];

    $GLOBALS['log']->debug("_REQUEST: ".print_r($_REQUEST,true));

	if (is_file(getcwd().'/iphone.php') && ($mode == 'Install'))
	{
	    print('chmod('.getcwd().'/iphone.php'.',0755'.'<br>');
	    chmod(getcwd().'/iphone.php',0755);

	    print('chmod('.getcwd().'/sugar-iphone-client'.',0755'.'<br>');
	    chmod(getcwd().'/sugar-iphone-client',0755);

	    print('chmod('.getcwd().'/sugar-iphone-client/*'.',0755'.'<br>');
	    chmod(getcwd().'/sugar-iphone-client/copyright.php',0755);
	    chmod(getcwd().'/sugar-iphone-client/db_soap.php',0755);
	    chmod(getcwd().'/sugar-iphone-client/detail_masks.php',0755);
	    chmod(getcwd().'/sugar-iphone-client/footer.php',0755);
	    chmod(getcwd().'/sugar-iphone-client/header.php',0755);
	    chmod(getcwd().'/sugar-iphone-client/meta_array.php',0755);
	    chmod(getcwd().'/sugar-iphone-client/show_data_list.php',0755);
	    chmod(getcwd().'/sugar-iphone-client/show_detail.php',0755);
	    chmod(getcwd().'/sugar-iphone-client/show_list.php',0755);
	    chmod(getcwd().'/sugar-iphone-client/show_related.php',0755);
	    chmod(getcwd().'/sugar-iphone-client/stylesheet.css',0755);
	    chmod(getcwd().'/sugar-iphone-client/config.php',0755);

	    print('chmod('.getcwd().'/sugar-iphone-client/images'.',0755'.'<br>');
	    chmod(getcwd().'/sugar-iphone-client/images',0755);

	    print('chmod('.getcwd().'/sugar-iphone-client/images/*'.',0755'.'<br>');
	    chmod(getcwd().'/sugar-iphone-client/images/add.png',0755);
	    chmod(getcwd().'/sugar-iphone-client/images/go_back.gif',0755);
	    chmod(getcwd().'/sugar-iphone-client/images/scroll.gif',0755);
	    chmod(getcwd().'/sugar-iphone-client/images/scroll_back.gif',0755);
	    chmod(getcwd().'/sugar-iphone-client/images/scroll_end.gif',0755);
	    chmod(getcwd().'/sugar-iphone-client/images/scroll_start.gif',0755);
	}

    $GLOBALS['log']->debug("End of sugar-iphone-client installation");
  }


////	END POST INSTALL
///////////////////////////////////////////////////////////////////////////////
?>
